package com.example.hengjun.operation_oracle.service.Impl;


import com.example.hengjun.operation_oracle.entity.Testuser;
import com.example.hengjun.operation_oracle.mapper.UserMapper;
import com.example.hengjun.operation_oracle.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UserServiceImpl implements UserService {
    @Resource
    private UserMapper userMapper;

    @Override
    public int addUser(Testuser user) {
        return userMapper.addUser(user.getId(), user.getName(), user.getAge());
    }

    @Override
    public int deleteUser(Integer id) {
        return userMapper.deleteUser(id);
    }

    @Override
    public Testuser findByName(String name) {
        return userMapper.findByName(name);
    }

    @Override
    public int update(Testuser user) {
        return userMapper.updape(user.getId(), user.getName(), user.getAge());
    }
}
